PowerTABLE 1.1 ===== Routine description ************************************************************************************* db_AddIndex() ************************************************************************************* Purpose: Function to add a new index to an openeded database Prototype in: COMPACT.BAS Syntax: tf = db_AddIndex% (db As Database, tablename$, ixn$, ixf$, ixu%, ixp%) Parameters: db - the database object variable tablename - the name of the sourcetable ixn - the name for the new index ixf - list of fields for the new index ixu - true if itīs a unique index, false if not ixp - true if itīs a primary index, false if not Returns: True if index was successfully generated. False if an error has occured. Example: dim db as database, tb as table set db=opendatabase ("MYDATA.MDB") set tb=db.opentable("MYTABLE") if db_AddIndex ( db, tb, "NewIndex","+Field1;+Field2",False,False ) then msgBox "Ok" else msgBox "Error" end if ************************************************************************************* dbf_CompactDatabase() ************************************************************************************* Purpose: Compacts an entire xBase database Prototype in: COMPACT.BAS Syntax: tf = dbf_CompactDatabase ( dbName$, dbConnect$ ) Parameters: dbName - the name/directory of the database dbConnect - the connect-property either "dbase iv;" or "foxpro 2.5;" Returns: True if successful, False if not Remarks: The database will be opened for exclusive usage. Example: tf = dbf_CompactDataBase ("C:\MYPROJ","dbase iv;") ************************************************************************************* dbf_CompactTable() ************************************************************************************* Purpose: Compacts a single xBase table Prototype in: COMPACT.BAS Syntax: tf = dbf_CompactTable ( dBName$, dBConnect$, tablename$ ) Parameters: dBName - Name/Directory of the database dbConnect - the connect-property either "dbase iv;" or "foxpro 2.5;" tableName - Name of the table Returns: True if successful, False if not Remarks: The database will be opened for exclusive usage. Example: tf = dbf_CompactTable ( "C:\MYPROJ","foxpro 2.5;","CUSTOM" ) ************************************************************************************* ini_InitDataAccess() ************************************************************************************* Purpose: Initializes VBRUN300.DLL for access to external databases Prototype in: AUTOINI.BAS Syntax: ini_initDataAccess Parameters: (none) Returns: (nothing) Remarks: This routine creates or corrects an .INI file automatically, if you want to access external tables in your program. The name of the created .INI-file is the name of your application and itīs stored into the home-directory of your program - not in your Windows-directory. Call this routine at the entry of your program, and the message: "Installable ISAM not found!" is history. Example: sub main ini_initDataAccess . mdiForm.show 1 . end sub - or - sub frmMain_load () ini_initDataAccess . . . end sub ************************************************************************************* ini_do() ************************************************************************************* Purpose: Reads or writes a profile value from/to your private .INI file Prototype in: AUTOINI.BAS Syntax: ini_do section$, key$, value, R/W Parameters: section - the section where the string is located If section is "", the previous name is used again. key - the key name value - the returned or written value R/W - True if the value should be written to the file, False if the value will be returned Returns: value, if R/W was false Remarks: This function does not require a filename. The name of the .INI-file is the name of your application and itīs stored into the home-directory of your program - not in your Windows-directory. Example: ini_do "Data-Access","Username",uname,False msgBox "Your Name is " & uname This sequence would read a section like that: [Data-Access] Username=Mr.Big